package com.xiaoyu.lanling.media.image.fresco

import android.net.Uri
import com.facebook.cache.common.CacheKey
import com.facebook.imagepipeline.cache.BitmapMemoryCacheKey
import com.facebook.imagepipeline.common.ImageDecodeOptions
import com.facebook.imagepipeline.common.ResizeOptions
import com.facebook.imagepipeline.common.RotationOptions

class BitmapMemoryCacheKey(
    sourceString: String, resizeOptions: ResizeOptions?,
    rotationOptions: RotationOptions, imageDecodeOptions: ImageDecodeOptions,
    postprocessorCacheKey: CacheKey?, postprocessorName: String?, callerContext: Any?
) : BitmapMemoryCacheKey(
    sourceString,
    resizeOptions,
    rotationOptions,
    imageDecodeOptions,
    postprocessorCacheKey,
    postprocessorName,
    callerContext
) {

    /**
     * override this function because: https://github.com/facebook/fresco/issues/2505
     */
    override fun containsUri(uri: Uri?): Boolean {
        return uriString == uri.toString()
    }
}